import type { Vector3 } from 'three'

// 点到直线的距离
export function distanceTolineToPoint(a: Vector3, b: Vector3, o: Vector3) {
  const oa = o.clone().sub(a)
  const ob = o.clone().sub(b)
  const width = a.clone().sub(b)
  const arce = oa.cross(ob)
  const h = (0.5 * arce.length()) / width.length()
  return h
}